Produced by Araxis Merge on 2022-11-18 03:12:07 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Porto Theme/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view | addtocart.phtml | 2022-05-10 04:02:50 +0000 |
| 2 | Theme Files/Magento 2.x/Porto Theme/app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view | addtocart.phtml | 2022-05-10 04:02:50 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 1 | 446 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | 1 | <?php | |||
| 2 | /** | 2 | /** | |||
| 3 | * Copyright © 2015 Magento. All rights reserved. | 3 | * Copyright © 2015 Magento. All rights reserved. | |||
| 4 | * See COPYING.txt for license details. | 4 | * See COPYING.txt for license details. | |||
| 5 | */ | 5 | */ | |||
| 6 | 6 | |||||
| 7 | // @codingStandardsIgnoreFile | 7 | // @codingStandardsIgnoreFile | |||
| 8 | 8 | |||||
| 9 | /** @var $block \Magento\Catalog\Block\Product\View */ | 9 | /** @var $block \Magento\Catalog\Block\Product\View */ | |||
| 10 | ?> | 10 | ?> | |||
| 11 | <?php $_product = $block->getProduct(); ?> | 11 | <?php $_product = $block->getProduct(); ?> | |||
| 12 | <?php $buttonTitle = __('Add to Cart'); ?> | 12 | <?php $buttonTitle = __('Add to Cart'); ?> | |||
| 13 | <?php $dailydealhelper=$this->helper('Smartwave\Dailydeals\Helper\Data'); ?> | 13 | <?php $dailydealhelper=$this->helper('Smartwave\Dailydeals\Helper\Data'); ?> | |||
| 14 | <?php if ($_product->isSaleable()): ?> | 14 | <?php if ($_product->isSaleable()): ?> | |||
| 15 | <div class="box-tocart"> | 15 | <div class="box-tocart"> | |||
| 16 | <?php if($block->getRequest()->getParam('dailydealproduct') || $dailydealhelper->isDealProduct($_product->getId())) : ?> | 16 | <?php if($block->getRequest()->getParam('dailydealproduct') || $dailydealhelper->isDealProduct($_product->getId())) : ?> | |||
| 17 | <?php $productSku=$_product->getSku(); ?> | 17 | <?php $productSku=$_product->getSku(); ?> | |||
| 18 | <input type="text" id="todate" value="<?php echo $dailydealhelper->getDailydealToDate($productSku); ?>" style="display:none;" > | 18 | <input type="text" id="todate" value="<?php echo $dailydealhelper->getDailydealToDate($productSku); ?>" style="display:none;" > | |||
| 19 | <input type="text" style="display: none;" id="fromdate" value="<?php echo $dailydealhelper->getDailydealFromDate($productSku); ?>"> | 19 | <input type="text" style="display: none;" id="fromdate" value="<?php echo $dailydealhelper->getDailydealFromDate($productSku); ?>"> | |||
| 20 | <p id="countdown"></p> | 20 | <p id="countdown"></p> | |||
| 21 | <div class="sw-dailydeal-wrapper"> | 21 | <div class="sw-dailydeal-wrapper"> | |||
| 22 | <div class="sw-dailydeal"> | 22 | <div class="sw-dailydeal"> | |||
| 23 | <?php if($block->getRequest()->getParam('dailydealproduct')) :?> | 23 | <?php if($block->getRequest()->getParam('dailydealproduct')) :?> | |||
| 24 | <p id="expired"></p> | 24 | <p id="expired"></p> | |||
| 25 | <?php endif; ?> | 25 | <?php endif; ?> | |||
| 26 | <div class="countdowncontainer" style="display:none;"> | 26 | <div class="countdowncontainer" style="display:none;"> | |||
| 27 | <span class="dailydeal-label"> | 27 | <span class="dailydeal-label"> | |||
| 28 | <?php echo __('Offer Ends In:'); ?> | 28 | <?php echo __('Offer Ends In:'); ?> | |||
| 29 | </span> | 29 | </span> | |||
| 30 | <span class="number-wrapper"> | 30 | <span class="number-wrapper"> | |||
| 31 | <div class="line"></div> | 31 | <div class="line"></div> | |||
| 32 | <span class="number day"><p id="countdown_days"></p></span> | 32 | <span class="number day"><p id="countdown_days"></p></span> | |||
| 33 | <div class="caption"><?php echo __('Days'); ?></div> | 33 | <div class="caption"><?php echo __('Days'); ?></div> | |||
| 34 | </span> | 34 | </span> | |||
| 35 | 35 | |||||
| 36 | <span class="number-wrapper"> | 36 | <span class="number-wrapper"> | |||
| 37 | <div class="line"></div> | 37 | <div class="line"></div> | |||
| 38 | <span class="number hour"><p id="countdown_hours"></p></span> | 38 | <span class="number hour"><p id="countdown_hours"></p></span> | |||
| 39 | <div class="caption"><?php echo __('Hours'); ?></div> | 39 | <div class="caption"><?php echo __('Hours'); ?></div> | |||
| 40 | </span> | 40 | </span> | |||
| 41 | 41 | |||||
| 42 | <span class="number-wrapper"> | 42 | <span class="number-wrapper"> | |||
| 43 | <div class="line"></div> | 43 | <div class="line"></div> | |||
| 44 | <span class="number min"><p id="countdown_minutes"></p></span> | 44 | <span class="number min"><p id="countdown_minutes"></p></span> | |||
| 45 | <div class="caption"><?php echo __('Minutes'); ?></div> | 45 | <div class="caption"><?php echo __('Minutes'); ?></div> | |||
| 46 | </span> | 46 | </span> | |||
| 47 | 47 | |||||
| 48 | <span class="number-wrapper"> | 48 | <span class="number-wrapper"> | |||
| 49 | <div class="line"></div> | 49 | <div class="line"></div> | |||
| 50 | <span class="number sec"><p id="countdown_seconds"></p></span> | 50 | <span class="number sec"><p id="countdown_seconds"></p></span> | |||
| 51 | <div class="caption"><?php echo __('Seconds'); ?></div> | 51 | <div class="caption"><?php echo __('Seconds'); ?></div> | |||
| 52 | </span> | 52 | </span> | |||
| 53 | </div> | 53 | </div> | |||
| 54 | </div> | 54 | </div> | |||
| 55 | </div> | 55 | </div> | |||
| 56 | <?php endif; ?> | 56 | <?php endif; ?> | |||
| 57 | <div class="fieldset"> | 57 | <div class="fieldset"> | |||
| 58 | <?php if ($block->shouldRenderQuantity()): ?> | 58 | <?php if ($block->shouldRenderQuantity()): ?> | |||
| 59 | <div class="field qty"> | 59 | <div class="field qty"> | |||
| 60 | <label class="label" for="qty"><span><?php /* @escapeNotVerified */ echo __('Qty') ?>:</span></label> | 60 | <label class="label" for="qty"><span><?php /* @escapeNotVerified */ echo __('Qty') ?>:</span></label> | |||
| 61 | <div class="control"> | 61 | <div class="control"> | |||
| 62 | <input type="number" | 62 | <input type="number" | |||
| 63 | name="qty" | 63 | name="qty" | |||
| 64 | id="qty" | 64 | id="qty" | |||
| 65 | maxlength="12" | 65 | maxlength="12" | |||
| 66 | value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>" | 66 | value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>" | |||
| 67 | title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty" | 67 | title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty" | |||
| 68 | data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>" | 68 | data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>" | |||
| 69 | /> | 69 | /> | |||
| 70 | <div class="qty-changer"> | 70 | <div class="qty-changer"> | |||
| 71 | <a href="javascript:void(0)" class="qty-inc"><i class="porto-icon-up-dir"></i></a> | 71 | <a href="javascript:void(0)" class="qty-inc"><i class="porto-icon-up-dir"></i></a> | |||
| 72 | <a href="javascript:void(0)" class="qty-dec"><i class="porto-icon-down-dir"></i></a> | 72 | <a href="javascript:void(0)" class="qty-dec"><i class="porto-icon-down-dir"></i></a> | |||
| 73 | </div> | 73 | </div> | |||
| 74 | </div> | 74 | </div> | |||
| 75 | </div> | 75 | </div> | |||
| 76 | <?php endif; ?> | 76 | <?php endif; ?> | |||
| 77 | <div class="actions"> | 77 | <div class="actions"> | |||
| 78 | <button type="submit" | 78 | <button type="submit" | |||
| 79 | title="<?php /* @escapeNotVerified */ echo $buttonTitle ?>" | 79 | title="<?php /* @escapeNotVerified */ echo $buttonTitle ?>" | |||
| 80 | class="action primary tocart" | 80 | class="action primary tocart" | |||
| 81 | id="product-addtocart-button"> | 81 | id="product-addtocart-button"> | |||
| 82 | <span><?php /* @escapeNotVerified */ echo $buttonTitle ?></span> | 82 | <span><?php /* @escapeNotVerified */ echo $buttonTitle ?></span> | |||
| 83 | </button> | 83 | </button> | |||
| 84 | <?php echo $block->getChildHtml('', true) ?> | 84 | <?php echo $block->getChildHtml('', true) ?> | |||
| 85 | </div> | 85 | </div> | |||
| 86 | </div> | 86 | </div> | |||
| 87 | </div> | 87 | </div> | |||
| 88 | <?php endif; ?> | 88 | <?php endif; ?> | |||
| 89 | <?php if ($block->isRedirectToCartEnabled()) : ?> | 89 | <?php if ($block->isRedirectToCartEnabled()) : ?> | |||
| 90 | <script type="text/x-magento-init"> | 90 | <script type="text/x-magento-init"> | |||
| 91 | { | 91 | { | |||
| 92 | "#product_addtocart_form": { | 92 | "#product_addtocart_form": { | |||
| 93 | "Magento_Catalog/product/view/validation": { | 93 | "Magento_Catalog/product/view/validation": { | |||
| 94 | "radioCheckboxClosest": ".nested" | 94 | "radioCheckboxClosest": ".nested" | |||
| 95 | } | 95 | } | |||
| 96 | } | 96 | } | |||
| 97 | } | 97 | } | |||
| 98 | </script> | 98 | </script> | |||
| 99 | <?php else : ?> | 99 | <?php else : ?> | |||
| 100 | <script> | 100 | <script> | |||
| 101 | require([ | 101 | require([ | |||
| 102 | 'jquery', | 102 | 'jquery', | |||
| 103 | 'mage/mage', | 103 | 'mage/mage', | |||
| 104 | 'Magento_Catalog/product/view/validation', | 104 | 'Magento_Catalog/product/view/validation', | |||
| 105 | 'Magento_Catalog/js/catalog-add-to-cart' | 105 | 'Magento_Catalog/js/catalog-add-to-cart' | |||
| 106 | ], function ($) { | 106 | ], function ($) { | |||
| 107 | 'use strict'; | 107 | 'use strict'; | |||
| 108 | 108 | |||||
| 109 | $('#product_addtocart_form').mage('validation', { | 109 | $('#product_addtocart_form').mage('validation', { | |||
| 110 | radioCheckboxClosest: '.nested', | 110 | radioCheckboxClosest: '.nested', | |||
| 111 | submitHandler: function (form) { | 111 | submitHandler: function (form) { | |||
| 112 | var widget = $(form).catalogAddToCart({ | 112 | var widget = $(form).catalogAddToCart({ | |||
| 113 | bindSubmit: false | 113 | bindSubmit: false | |||
| 114 | }); | 114 | }); | |||
| 115 | 115 | |||||
| 116 | widget.catalogAddToCart('submitForm', $(form)); | 116 | widget.catalogAddToCart('submitForm', $(form)); | |||
| 117 | 117 | |||||
| 118 | return false; | 118 | return false; | |||
| 119 | } | 119 | } | |||
| 120 | }); | 120 | }); | |||
| 121 | }); | 121 | }); | |||
| 122 | </script> | 122 | </script> | |||
| 123 | <?php endif; ?> | 123 | <?php endif; ?> | |||
| 124 | <script type="text/javascript"> | 124 | <script type="text/javascript"> | |||
| 125 | require([ | 125 | require([ | |||
| 126 | 'jquery' | 126 | 'jquery' | |||
| 127 | ], function ($) { | 127 | ], function ($) { | |||
| 128 | var app = { | 128 | var app = { | |||
| 129 | isAppleDevice: function() { | 129 | isAppleDevice: function() { | |||
| 130 | if (navigator.userAgent.match(/(iPhone|iPod|iPad|Safari)/) != null) { | 130 | if (navigator.userAgent.match(/(iPhone|iPod|iPad|Safari)/) != null) { | |||
| 131 | return true; | 131 | return true; | |||
| 132 | } | 132 | } | |||
| 133 | return false; | 133 | return false; | |||
| 134 | } | 134 | } | |||
| 135 | } | 135 | } | |||
| 136 | // Timer for LEFT time for Dailydeal product | 136 | // Timer for LEFT time for Dailydeal product | |||
| 137 | var _second = 1000; | 137 | var _second = 1000; | |||
| 138 | var _minute = _second * 60; | 138 | var _minute = _second * 60; | |||
| 139 | var _hour = _minute * 60; | 139 | var _hour = _minute * 60; | |||
| 140 | var _day = _hour * 24; | 140 | var _day = _hour * 24; | |||
| 141 | var timer; | 141 | var timer; | |||
| 142 | 142 | |||||
| 143 | function showRemaining(currentdate) { | 143 | function showRemaining(currentdate) { | |||
| 144 | var cid='countdown'; | 144 | var cid='countdown'; | |||
| 145 | var startdateid='fromdate'; | 145 | var startdateid='fromdate'; | |||
| 146 | var id='todate'; | 146 | var id='todate'; | |||
| 147 | var daysid='countdown_days'; | 147 | var daysid='countdown_days'; | |||
| 148 | var hoursid='countdown_hours'; | 148 | var hoursid='countdown_hours'; | |||
| 149 | var minutesid='countdown_minutes'; | 149 | var minutesid='countdown_minutes'; | |||
| 150 | var secondsid='countdown_seconds'; | 150 | var secondsid='countdown_seconds'; | |||
| 151 | 151 | |||||
| 152 | var enddate = new Date($('#'+id).val()); | 152 | var enddate = new Date($('#'+id).val()); | |||
| 153 | var dealstartdate=new Date($('#'+startdateid).val()); | 153 | var dealstartdate=new Date($('#'+startdateid).val()); | |||
| 154 | if (app.isAppleDevice() && $('#'+id).val() && $('#'+startdateid).val()) { | 154 | if (app.isAppleDevice() && $('#'+id).val() && $('#'+startdateid).val()) { | |||
| 155 | var edate = $('#'+id).val(); | 155 | var edate = $('#'+id).val(); | |||
| 156 | var edateParts = edate.substring(0,10).split('-'); | 156 | var edateParts = edate.substring(0,10).split('-'); | |||
| 157 | var etimePart = edate.substr(11); | 157 | var etimePart = edate.substr(11); | |||
| 158 | enddate = edateParts[1] + '/' + edateParts[2] + '/' + edateParts[0] + ' ' + etimePart; | 158 | enddate = edateParts[1] + '/' + edateParts[2] + '/' + edateParts[0] + ' ' + etimePart; | |||
| 159 | enddate = new Date(enddate).getTime(); | 159 | enddate = new Date(enddate).getTime(); | |||
| 160 | 160 | |||||
| 161 | var sdate = $('#'+startdateid).val(); | 161 | var sdate = $('#'+startdateid).val(); | |||
| 162 | var sdateParts = sdate.substring(0,10).split('-'); | 162 | var sdateParts = sdate.substring(0,10).split('-'); | |||
| 163 | var stimePart = sdate.substr(11); | 163 | var stimePart = sdate.substr(11); | |||
| 164 | dealstartdate = sdateParts[1] + '/' + sdateParts[2] + '/' + sdateParts[0] + ' ' + stimePart; | 164 | dealstartdate = sdateParts[1] + '/' + sdateParts[2] + '/' + sdateParts[0] + ' ' + stimePart; | |||
| 165 | dealstartdate = new Date(dealstartdate).getTime(); | 165 | dealstartdate = new Date(dealstartdate).getTime(); | |||
| 166 | } | 166 | } | |||
| 167 | // Get Current Date from magentodatetime | 167 | // Get Current Date from magentodatetime | |||
| 168 | 168 | |||||
| 169 | var currentdate=new Date(currentdate).getTime(); | 169 | var currentdate=new Date(currentdate).getTime(); | |||
| 170 | //Get Difference between Two dates | 170 | //Get Difference between Two dates | |||
| 171 | var distance = enddate - currentdate; | 171 | var distance = enddate - currentdate; | |||
| 172 | if (distance < 0) { | 172 | if (distance < 0) { | |||
| 173 | $('#expired').html("<div class='offermessage' >EXPIRED!</div>"); | 173 | $('#expired').html("<div class='offermessage' >EXPIRED!</div>"); | |||
| 174 | } else if(dealstartdate > currentdate) { | 174 | } else if(dealstartdate > currentdate) { | |||
| 175 | $('.countdowncontainer').hide(); | 175 | $('.countdowncontainer').hide(); | |||
| 176 | var msg="<div class='offermessage' > Coming Soon..<br>Deal Start at:<br>"+$('#'+startdateid).val()+"</div>"; | 176 | var msg="<div class='offermessage' > Coming Soon..<br>Deal Start at:<br>"+$('#'+startdateid).val()+"</div>"; | |||
| 177 | $('#expired').html(msg); | 177 | $('#expired').html(msg); | |||
| 178 | } else { | 178 | } else { | |||
| 179 | var days = Math.floor(distance / _day); | 179 | var days = Math.floor(distance / _day); | |||
| 180 | var hours = Math.floor((distance % _day) / _hour); | 180 | var hours = Math.floor((distance % _day) / _hour); | |||
| 181 | var minutes = Math.floor((distance % _hour) / _minute); | 181 | var minutes = Math.floor((distance % _hour) / _minute); | |||
| 182 | var seconds = Math.floor((distance % _minute) / _second); | 182 | var seconds = Math.floor((distance % _minute) / _second); | |||
| 183 | if(hours < 10) | 183 | if(hours < 10) | |||
| 184 | hours = "0" + hours; | 184 | hours = "0" + hours; | |||
| 185 | if(minutes < 10) | 185 | if(minutes < 10) | |||
| 186 | minutes = "0" + minutes; | 186 | minutes = "0" + minutes; | |||
| 187 | if(seconds < 10) | 187 | if(seconds < 10) | |||
| 188 | seconds = "0" + seconds; | 188 | seconds = "0" + seconds; | |||
| 189 | $('.countdowncontainer').show(); | 189 | $('.countdowncontainer').show(); | |||
| 190 | $('#'+daysid).html(days); | 190 | $('#'+daysid).html(days); | |||
| 191 | $('#'+hoursid).html(hours); | 191 | $('#'+hoursid).html(hours); | |||
| 192 | $('#'+minutesid).html(minutes); | 192 | $('#'+minutesid).html(minutes); | |||
| 193 | $('#'+secondsid).html(seconds); | 193 | $('#'+secondsid).html(seconds); | |||
| 194 | } | 194 | } | |||
| 195 | } | 195 | } | |||
| 196 | 196 | |||||
| 197 | //Set date as magentodatetime | 197 | //Set date as magentodatetime | |||
| 198 | var date = new Date('<?php echo $dailydealhelper->getcurrentDate() ?>'); | 198 | var date = new Date('<?php echo $dailydealhelper->getcurrentDate() ?>'); | |||
| 199 | if (app.isAppleDevice()) { | 199 | if (app.isAppleDevice()) { | |||
| 200 | var mdate = '<?php echo $dailydealhelper->getcurrentDate() ?>'; | 200 | var mdate = '<?php echo $dailydealhelper->getcurrentDate() ?>'; | |||
| 201 | var dateParts = mdate.substring(0,10).split('-'); | 201 | var dateParts = mdate.substring(0,10).split('-'); | |||
| 202 | var timePart = mdate.substr(11); | 202 | var timePart = mdate.substr(11); | |||
| 203 | date = dateParts[1] + '/' + dateParts[2] + '/' + dateParts[0] + ' ' + timePart; | 203 | date = dateParts[1] + '/' + dateParts[2] + '/' + dateParts[0] + ' ' + timePart; | |||
| 204 | date = new Date(date); | 204 | date = new Date(date); | |||
| 205 | } | 205 | } | |||
| 206 | var day = date.getDate(); | 206 | var day = date.getDate(); | |||
| 207 | var month = date.getMonth(); | 207 | var month = date.getMonth(); | |||
| 208 | var year = date.getFullYear(); | 208 | var year = date.getFullYear(); | |||
| 209 | var hours = date.getHours(); | 209 | var hours = date.getHours(); | |||
| 210 | var minutes = "0" + date.getMinutes(); | 210 | var minutes = "0" + date.getMinutes(); | |||
| 211 | var seconds = "0" + date.getSeconds(); | 211 | var seconds = "0" + date.getSeconds(); | |||
| 212 | 212 | |||||
| 213 | var fulldate = year+'/'+(month+1)+'/'+day+' '+hours + ':' + minutes.substr(minutes.length-2) + ':' + seconds.substr(seconds.length-2); | 213 | var fulldate = year+'/'+(month+1)+'/'+day+' '+hours + ':' + minutes.substr(minutes.length-2) + ':' + seconds.substr(seconds.length-2); | |||
| 214 | // Set Interval | 214 | // Set Interval | |||
| 215 | timer = setInterval(function() | 215 | timer = setInterval(function() | |||
| 216 | { | 216 | { | |||
| 217 | date.setSeconds(date.getSeconds() + 1); | 217 | date.setSeconds(date.getSeconds() + 1); | |||
| 218 | var month=date.getMonth(); | 218 | var month=date.getMonth(); | |||
| 219 | var currentdatetime=date.getFullYear()+"/"+(month+1)+"/"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds(); | 219 | var currentdatetime=date.getFullYear()+"/"+(month+1)+"/"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds(); | |||
| 220 | showRemaining(currentdatetime); | 220 | showRemaining(currentdatetime); | |||
| 221 | }, 1000); | 221 | }, 1000); | |||
| 222 | }); | 222 | }); | |||
| 223 | </script> | 223 | </script> |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.